package com.fresher.model;

import java.io.Serializable;

import javax.persistence.*;

import java.util.List;


/**
 * The persistent class for the accountinfo database table.
 * 
 */
@Entity
//@NamedQuery(name="Accountinfo.findAll", query="SELECT a FROM Accountinfo a")
public class Accountinfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int idaccountInfo;

	private String accountType;

	private String addr1;

	private String addr2;

	private int balance;

	private String email1;

	private String email2;

	private String firstName;

	private int idCardNumber;

	private String lastName;

	private String midName;

	private int phone1;

	private int phone2;

	private byte state;

	//bi-directional many-to-one association to Transaction
	@OneToMany(mappedBy="accountinfo1")
	private List<Transaction> transactions1;
	
	

	//bi-directional many-to-one association to Transaction
	@OneToMany(mappedBy="accountinfo2")
	private List<Transaction> transactions2;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="username")
	private User user;

	public Accountinfo(int idaccountInfo, String accountType, String addr1,
			String addr2, int balance, String email1, String email2,
			String firstName, int idCardNumber, String lastName,
			String midName, int phone1, int phone2, byte state,
		
			User user) {
		super();
		this.idaccountInfo = idaccountInfo;
		this.accountType = accountType;
		this.addr1 = addr1;
		this.addr2 = addr2;
		this.balance = balance;
		this.email1 = email1;
		this.email2 = email2;
		this.firstName = firstName;
		this.idCardNumber = idCardNumber;
		this.lastName = lastName;
		this.midName = midName;
		this.phone1 = phone1;
		this.phone2 = phone2;
		this.state = state;
		
		this.user = user;
	}

	public Accountinfo() {
	}

	public int getIdaccountInfo() {
		return this.idaccountInfo;
	}

	public void setIdaccountInfo(int idaccountInfo) {
		this.idaccountInfo = idaccountInfo;
	}

	public String getAccountType() {
		return this.accountType;
	}

	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}

	public String getAddr1() {
		return this.addr1;
	}

	public void setAddr1(String addr1) {
		this.addr1 = addr1;
	}

	public String getAddr2() {
		return this.addr2;
	}

	public void setAddr2(String addr2) {
		this.addr2 = addr2;
	}

	public int getBalance() {
		return this.balance;
	}

	public void setBalance(int balance) {
		this.balance = balance;
	}

	public String getEmail1() {
		return this.email1;
	}

	public void setEmail1(String email1) {
		this.email1 = email1;
	}

	public String getEmail2() {
		return this.email2;
	}

	public void setEmail2(String email2) {
		this.email2 = email2;
	}

	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public int getIdCardNumber() {
		return this.idCardNumber;
	}

	public void setIdCardNumber(int idCardNumber) {
		this.idCardNumber = idCardNumber;
	}

	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getMidName() {
		return this.midName;
	}

	public void setMidName(String midName) {
		this.midName = midName;
	}

	public int getPhone1() {
		return this.phone1;
	}

	public void setPhone1(int phone1) {
		this.phone1 = phone1;
	}

	public int getPhone2() {
		return this.phone2;
	}

	public void setPhone2(int phone2) {
		this.phone2 = phone2;
	}

	public byte getState() {
		return this.state;
	}

	public void setState(byte state) {
		this.state = state;
	}

	public List<Transaction> getTransactions1() {
		return this.transactions1;
	}

	public void setTransactions1(List<Transaction> transactions1) {
		this.transactions1 = transactions1;
	}

	public Transaction addTransactions1(Transaction transactions1) {
		getTransactions1().add(transactions1);
		transactions1.setAccountinfo1(this);

		return transactions1;
	}

	public Transaction removeTransactions1(Transaction transactions1) {
		getTransactions1().remove(transactions1);
		transactions1.setAccountinfo1(null);

		return transactions1;
	}

	public List<Transaction> getTransactions2() {
		return this.transactions2;
	}

	public void setTransactions2(List<Transaction> transactions2) {
		this.transactions2 = transactions2;
	}

	public Transaction addTransactions2(Transaction transactions2) {
		getTransactions2().add(transactions2);
		transactions2.setAccountinfo2(this);

		return transactions2;
	}

	public Transaction removeTransactions2(Transaction transactions2) {
		getTransactions2().remove(transactions2);
		transactions2.setAccountinfo2(null);

		return transactions2;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}